package com.hd.controller.activiti;

import com.hd.controller.base.BaseController;
import com.hd.entity.activiti.ProcessInsCc;
import com.hd.service.activiti.ProcessInsCcService;
import com.hd.util.result.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/processInsCc")
public class ProcessInsCcController extends BaseController {
    @Autowired
    private ProcessInsCcService processInsCcService;

    @RequestMapping("/index")
    public String toIndex(){
        System.out.println(123);
        return "jsp/activiti/processInsCc/processInsCcList";
    }

    @RequestMapping(value = "/dataGrid")
    @ResponseBody
    public Object selectDataGrid(ProcessInsCc processInsCc,int page,int rows){
        PageInfo info=new PageInfo(page,rows);
        Map<String,Object> condition=new HashMap<String,Object>();
        info.setCondition(condition);
        processInsCcService.selectDataGrid(info,processInsCc);
        return info;
    }

    @ResponseBody
    @RequestMapping("/updateReadStatus")
    public Object updateReadStatus(String objId,String userId){
        processInsCcService.updateReadStatus(objId,userId);
        return renderSuccess();
    }
}
